#pragma once
#include "DXUT.h"
#include "JointAnimationKey.h"
#include <dae.h>
#include <dom.h>
#include <dom/domCOLLADA.h>
#include "ColladaLibs.h"
#include <string>
#include <vector>

using namespace std;

class Joint
{
	public:
	//SID
	string SID;
	//Node for this in the COLLADA file
	daeElement* Node;
	//Animation Keys for this Joint
	vector<JointAnimationKey> Animations;
	//COLLADALoader access rights
	//friend class COLLADALoader;
	//SkinnedMesh access rights
	//friend class SkinnedMesh;
public:
	//Name
	string Name;
	//Bind_Matrix
	D3DXMATRIX bind_matrix;
	//Inv_Bind_Matrix
	D3DXMATRIX inv_bind_matrix;
	//Parent Index
	int parentIndex;
	//Parent Joint*
	Joint* parentJoint;
	//Base Constructor
	Joint()
	{
		//Initialize SID
		SID = string();
		//Initialize Node
		Node = NULL;
		//Initialize Animations
		Animations = vector<JointAnimationKey>();
		//Initialize Name
		Name = string();
		//Initialize bind_matrix
		D3DXMatrixIdentity(&bind_matrix);
		//Initialize inv_bind_matrix
		D3DXMatrixIdentity(&inv_bind_matrix);
		//Initialize parentIndex
		parentIndex = 0;
		//Initialize parentJoint
		parentJoint = NULL;
	}
	//Detailed Constructor
	Joint(string Name, string SID, daeElement* Node)
	{
		//Initialize SID
		this->SID = SID;
		//Initialize Node
		this->Node = Node;
		//Initialize Animations
		Animations = vector<JointAnimationKey>();
		//Initialize Name
		this->Name = Name;
		//Initialize bind_matrix
		D3DXMatrixIdentity(&bind_matrix);
		//Initialize inv_bind_matrix
		D3DXMatrixIdentity(&inv_bind_matrix);
		//Initialize parentIndex
		parentIndex = 0;
		//Initialize parentJoint
		parentJoint = NULL;
	}
};
